package com.kaoyaya.delivery.activity;

import android.content.Intent;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.googlecode.androidannotations.annotations.AfterViews;
import com.googlecode.androidannotations.annotations.Click;
import com.googlecode.androidannotations.annotations.EActivity;
import com.googlecode.androidannotations.annotations.NoTitle;
import com.googlecode.androidannotations.annotations.ViewById;
import com.googlecode.androidannotations.annotations.sharedpreferences.Pref;
import com.kaoyaya.delivery.data.InfoFile_;

@NoTitle
@EActivity(R.layout.activity_user_center)
public class UserCenterActivity extends BaseActivity{
	
	@ViewById TextView tvTitle, tvUsername, tvRealname, tvMobile, tvEmail;
	@ViewById LinearLayout llChangeUser, llFeedback;
	@Pref InfoFile_ infoFile;
	
	@AfterViews
	void initView() {
		app.addActivity(this);
		tvTitle.setText("个人中心");
		tvUsername.setText(infoFile.username().get());
		tvRealname.setText(infoFile.realname().get());
		tvMobile.setText(infoFile.mobile().get());
		tvEmail.setText(infoFile.email().get());
	}
	
	@Click
	void llChangeUser() {
		infoFile.isAutoLogin().put(false);
		startActivity(new Intent(context, UserLoginActivity_.class));
		finishAllActivity();
	}
	
	@Click
	void llFeedback() {
		startActivity(new Intent(context, FeedbackActivity_.class));
	}
	
}
